package com.shop.shop_end.utils;

import java.util.Random;
import java.util.UUID;

import static org.cyberneko.html.HTMLElements.BASE;

/**
 * 生成id
 */
public class GenerateIdUtil {
    private GenerateIdUtil(){

    }

    public static Long generateId() {
        Random random = new Random();
        long time = System.currentTimeMillis();
        long timestamp = time - BASE;
        long randomNum = (random.nextInt(9000000) + 1000000); // 生成1000000到9999999之间的随机数
        long result = (timestamp * 1000) + randomNum;
        return result;
    }
}
